﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="addRecipe.aspx.vb" Inherits="mybaconrecipeprototype.addRecipe" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <h1>Add A Recipe</h1>
    </p>
    <p>
    <table cellpadding="0" cellspacing="0" width="500px" id="inputTable">
    <tr>
        <td class="inputTableLHS">Recipe Name *</td>
        <td class="inputTableMID">
            <asp:TextBox ID="tb_RecipeName" runat="server"></asp:TextBox>
        </td>
        <td class="inputTableRHS"><asp:RequiredFieldValidator ID="vdreq_RecipeName" runat="server" 
                ControlToValidate="tb_RecipeName" CssClass="errorMessage" 
                ErrorMessage="This field cannot be left empty"></asp:RequiredFieldValidator></td>
    </tr>
    <tr>
        <td class="inputTableLHS">Rating *</td>
        <td class="inputTableMID">
            <asp:RadioButtonList ID="rbl_Rating" runat="server" 
                RepeatDirection="Horizontal">
                <asp:ListItem>1</asp:ListItem>
                <asp:ListItem>2</asp:ListItem>
                <asp:ListItem>3</asp:ListItem>
                <asp:ListItem>4</asp:ListItem>
                <asp:ListItem>5</asp:ListItem>
            </asp:RadioButtonList>
        </td>
                <td class="inputTableRHS">
                    <asp:RequiredFieldValidator ID="vdreq_Rating" runat="server" 
                ControlToValidate="rbl_Rating" CssClass="errorMessage" 
                ErrorMessage="This field cannot be left empty"></asp:RequiredFieldValidator></td>
    </tr>
    <tr>
        <td class="inputTableLHS">Cooking Time (in minutes) *</td>
        <td class="inputTableMID">
            <asp:TextBox ID="tb_CookingTime" runat="server"></asp:TextBox>
        </td>
        <td class="inputTableRHS">
            <asp:RequiredFieldValidator ID="vdreq_CookingTime" runat="server" 
                ControlToValidate="tb_CookingTime" CssClass="errorMessage" 
                ErrorMessage="This field cannot be left empty"></asp:RequiredFieldValidator><br />
            <asp:RegularExpressionValidator ID="vdnum_CookingTime" runat="server" 
                        ControlToValidate="tb_CookingTime" ErrorMessage="Only whole numbers allowed" 
                        ForeColor="Red" ValidationExpression="^(0|[1-9][0-9]*)$"></asp:RegularExpressionValidator>
        </td>
    </tr>
    <tr>
        <td class="inputTableLHS">Short Description *</td>
        <td class="inputTableMID">
            <asp:TextBox ID="tb_ShortDescription" runat="server" TextMode="MultiLine"></asp:TextBox>
        </td>
        <td class="inputTableRHS">
            <asp:RequiredFieldValidator ID="vdreq_ShortDesc" runat="server" 
                ControlToValidate="tb_ShortDescription" CssClass="errorMessage" 
                ErrorMessage="This field cannot be left empty"></asp:RequiredFieldValidator></td>
    </tr>
    <tr>
        <td class="inputTableLHS">Ingredients *</td>
        <td class="inputTableMID">
            <asp:TextBox ID="tb_Ingredients" runat="server" TextMode="MultiLine"></asp:TextBox>
        </td>
        <td class="inputTableRHS">
            <asp:RequiredFieldValidator ID="vdreq_Ingredients" runat="server" 
                ControlToValidate="tb_Ingredients" CssClass="errorMessage" 
                ErrorMessage="This field cannot be left empty"></asp:RequiredFieldValidator></td>
    </tr>
    <tr>
        <td class="inputTableLHS">Cooking Method *</td>
        <td class="inputTableMID">
            <asp:TextBox ID="tb_CookingMethod" runat="server" TextMode="MultiLine"></asp:TextBox>
        </td>
        <td class="inputTableRHS">
            <asp:RequiredFieldValidator ID="vdreq_CookingMethod" runat="server" 
                ControlToValidate="tb_CookingMethod" CssClass="errorMessage" 
                ErrorMessage="This field cannot be left empty"></asp:RequiredFieldValidator></td>
    </tr>
    <tr>
        <td class="inputTableLHS">Recipe Photo *</td>
        <td class="inputTableMID">
            <asp:FileUpload ID="f_Photo" runat="server" />
        </td>
        <td class="inputTableRHS">
            <asp:RequiredFieldValidator ID="vdreq_Photo" runat="server" 
                ControlToValidate="f_Photo" CssClass="errorMessage" 
                ErrorMessage="This field cannot be left empty"></asp:RequiredFieldValidator></td>
    </tr>
    <tr>
        <td class="inputTableLHS">Recipe Source URL</td>
        <td class="inputTableMID">
            </asp:TextBox><asp:TextBox ID="tb_RecipeSource" runat="server"></asp:TextBox>
        </td>
        <td class="inputTableRHS">
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                        ControlToValidate="tb_RecipeSource" ErrorMessage="Please enter a valid URL" 
                        ForeColor="Red" ValidationExpression="^(http(?:s)?\:\/\/[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*\.[a-zA-Z]{2,6}(?:\/?|(?:\/[\w\-]+)*)(?:\/?|\/\w+\.[a-zA-Z]{2,4}(?:\?[\w]+\=[\w\-]+)?)?(?:\&[\w]+\=[\w\-]+)*)$"></asp:RegularExpressionValidator>               
                
                </td>
    </tr>
    <tr>
        <td class="inputTableLHS">&nbsp;</td>
        <td class="inputTableMID">&nbsp;</td>
        <td class="inputTableRHS"> </td>
    </tr>
    <tr>
        <td class="inputTableLHS">&nbsp;</td>
        <td class="inputTableMID">
            <asp:Button ID="btn_Add" runat="server" Text="Add Recipe" />
        </td>
        <td class="inputTableRHS">&nbsp;</td>
    </tr>
    </table>
    </p>
    <p>
        <br />
    </p>
</asp:Content>
